package net.aaa.hotel.dao.impl;

import net.aaa.hotel.dao.UserDao;
import net.aaa.hotel.entity.Custom;
import net.aaa.hotel.util.BaseDB;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author 凉凉
 * @time
 */
@Repository
public class UserDaoImpl implements UserDao {
    @Override
    public List<Map> query(Map custom) {
       // System.out.println("idididid---"+custom);
        return BaseDB.queryMap("select id,name,iphone,pwd,idcard from custom where id=?",custom.get("id"));
    }

    @Override
    public int update(Custom xinxi) {
        return BaseDB.update("UPDATE custom set name=?,iphone=?,pwd=?,idcard=? where id =?",
                xinxi.getName(),
                xinxi.getIphone(),
                xinxi.getPwd(),
                xinxi.getIdcard(),
                xinxi.getId()
        );
    }
}
